<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="sch.jl.caigou.utils.Page"%>
<%@ page language="java" import="jiliang.purchase.demo.BusinessProcessing"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    
    <title>My JSP 'shenhe.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link href="CSS/common.css" rel="stylesheet" type="text/css" />
	<link href="CSS/date.css" rel="stylesheet" type="text/css" />

	<script src="JS/jquery-1.7.2.min.js" language="javascript" type="text/javascript"></script>
	<script src="JS/date.js" language="javascript" type="text/javascript"></script>
	<script src="JS/rili.js" language="javascript" type="text/javascript"></script>
	<script language="javascript">

	$(document).ready(function(){
		$("#starttime").cgCalendar();
		$("#endtime").cgCalendar();
		$("#ExportExcel").click(function()
		{		
			//alert("ExportExcelServlet?xmid="+$("#xmid").val()+"&&cbh="+$("#cbh").val()+"&&xingming="+encodeURI($("#xingming").val())+"&&starttime="+$("#starttime").val()+"&&endtime="+$("#endtime").val()+"&&zt="+$("#zt").val());
			window.location.href="ExportExcelServlet?xmid="+$("#xmid").val()+"&&cbh="+$("#cbh").val()+"&&xingming="+encodeURI($("#xingming").val())+"&&starttime="+$("#starttime").val()+"&&endtime="+$("#endtime").val()+"&&zt="+$("#zt").val();
		});
	});

</script>
<style>
	a{cursor:pointer;}
	a:hover{color:black;}
</style>
  </head>
  
<body>

<div class="banner">
<h1>F=欢迎计量学院网上审批系统上线</h1>
</div>

<div class="con sp_png">

	<div class="sp_main">
	<script type="text/javascript" src="JS/tips.js"></script>
		<div class="sideBar">
		<h3>审批管理</h3>
		<h4>欢迎您：<span>${Person.xingming}</span></h4>
				<dl>
				<dt>申请管理</dt>
				<dd><a href="TheFirst.jsp">在线申请</a></dd>
				<dd><a href="myShenqingServlet">我的申请</a></dd>
				<dd><a href="BusinessProcessServlet">业务处理</a></dd>
				<dd><a href="tongji.jsp">台账生成</a></dd>
				</dl>
				<dl>
				<dt>用户管理</dt>
				<dd><a href="YongHuliebiaoServlet">用户列表</a></dd>
				<dd><a href="tianjia.jsp">添加用户</a></dd>
				<dd><a href="xiugaimima.jsp">修改密码</a></dd>
				</dl>
				<dl>
		<dt>注销</dt>
		<dd><a>退出登录</a></dd>
		</dl>
		<p><input id="opentips" class="input_c" type="button" value="事件提醒"/></p>
		<p align="left" style="font-family:Verdana, Arial, Helvetica, sans-serif; color:#0000FF">
		<br>
		<br>
		<span style="font-size:14px; font-weight:bold">友情提示：</span>
		<br>
		使用本系统中如遇到问题，请与系统管理员联系。
		<br>
		系统管理员：王琳
		<br>
		联系电话：87676382
		</p>
		</div>
		<form method="post" class="shgl" action="myShenqingServlet" id="form1">
		<div class="sp_con">
			<h3> 业务处理</h3>
			<div class="topBar">
				
				
				申请类别：<select id="xmid" name="xmid" >
					<option value="0" >--全部业务--</option>
					<option value="1" >气瓶增置（充装）申购</option>
					<option value="2" >校重点监管危化品申领</option>
					<option value="3" >非校重点监管危化品申购</option>
					<option value="4" selected="selected">货物/服务申购</option>
				</select>
				<%
					String title = (String)request.getAttribute("returnTitle");
					//System.out.println("asdadad"+title);
					String[] titles={"","","","",""};
					titles = title.split("\\|");
					for(int i=0;i<titles.length;i++)
					{
						if(titles[i].equals("a") || titles[i].equals("b") || titles[i].equals("c") || titles[i].equals("d"))
						{
							titles[i]="";
						}
					}
						
				 %>
				流水号：<input name="cbh" type="text" id="cbh"  value="<%=titles[0]%>" size="10"/>
				<input name="xingming" type="hidden" id="xingming"  value="${Person.xingming}" size="10"/>
				开始时间：<input name="starttime" type="text" id="starttime"  value="<%=titles[2]%>" size="10"/>
				 截止时间：<input name="endtime" type="text" id="endtime"   value="<%=titles[3]%>" size="10"/>
				<!-- 审核结果：<select id="zt" name="zt">
					<option value="0" >--全部结果--</option>
					<option value="1" >待审核</option>
					<option value="2" >审核通过</option>
					<option value="3" >审核不通过</option>
				</select>-->
				业务状态：<select id="zt" name="zt">
					<option value="0" >--全部状态--</option>
					<option value="1" >未完成</option>
					<option value="2" >已完成</option>
					<option value="5" >不通过</option>
				</select>
				<script>
					$("#zt option").each(function(i)
					{
						if(this.value == <%=titles[4]%>)
							this.selected="selected";
					});
				</script>
				<input type="submit" value="查&nbsp;询"/>
	
			</div>
			<div class="data">
				<table width="100%" border="1" cellspacing="0" cellpadding="0">
				<tr class="title">
				  <th width="9%" align="center">流水号</th>
				  <th width="19%" align="center">申请类别</th>
				  <th width="13%" align="center">申请日期</th>
				  <th width="20%" align="center">已完成业务流程</th>
      			  <th width="15%" align="center">下一业务流程</th>      
				  <th width="15%" align="center">操作</th>      
				</tr>	
				<c:forEach items="${BusinessProcess.list}" var="BusinessProcess">
				<tr>
				  <td id="bh">${BusinessProcess.bh}</td>
				  <td>${BusinessProcess.xingming}</td>
				  <td>${BusinessProcess.sq_shijian}</td>
				  <td>${BusinessProcess.last_lc}</td>
      			  <td>${BusinessProcess.bz_mc}</td>
				  <td>
				  <c:if test="${BusinessProcess.bz_mc == '完成'}">
				  	<a href="checkMyShenqingServlet?bh=${BusinessProcess.bh}&&sign=2">查看申请</a>
				  </c:if>
				  <c:if test="${BusinessProcess.bz_mc != '完成'}">
				  	<a href="checkMyShenqingServlet?bh=${BusinessProcess.bh}&&sign=1">查看申请</a>
				  </c:if>
				  &nbsp;&nbsp;
				  <a onclick="dataDelete()">删除</a>
				  <br />
				  	 <c:choose>
				  	<c:when test="${BusinessProcess.states == '8'}">
				  		已入库
				  	</c:when>
				  	<c:when test="${BusinessProcess.states == '6'}">
				  		已回收
				  	</c:when>
				  	<c:when test="${BusinessProcess.states == '7'}">
				  		已分配给${BusinessProcess.allca_name}
				  	</c:when>
				  </c:choose>
				  </td>
				</tr>
				</c:forEach>
				<tr>
					<td height="25" colspan="7" align="center">
					 <input type="hidden" name="page" id="pageNum"/>
					<a onclick="PageTo(1)">第一页</a> 
					<c:if test="${BusinessProcess.hasPrev }">
					<a onclick="PageTo(${BusinessProcess.prevPage})">上一页</a>
					</c:if>
					<c:if test="${BusinessProcess.hasNext}">
					<a onclick="PageTo(${BusinessProcess.nextPage})"> 下一页</a>
					</c:if>  
					<a onclick="PageTo(${BusinessProcess.totalPageNumber})"> 最后一页</a> 
					当前 ${BusinessProcess.pageNo}/${BusinessProcess.totalPageNumber} 页  共 ${BusinessProcess.totalItemNumber}条 
					</td>
         	 	</tr>			

	          		  </table>
			  </div>
		</div>
		</form>
		<div class="clear"></div>
	</div>
</div>
<div class="footer png" style="position:relative;height:50px;">
<p>Copyright © 2012 版权所有：中国计量学院实验室与资产管理处 访问总量：<span>20243</span>次 <a>管理登录</a></p>
</div>
<script type="text/javascript">
function PageTo(pageNum)
{
	var page = document.getElementById("pageNum");
	var form1 = document.getElementById('form1');
	page.value = pageNum;
//	alert(page.value);
	form1.submit();
	
}

</script>
</body>
</html>
